<?php
$this->headScript()->appendScript(
'$(function() {
$( "#btnRefresh" )
.click(function( event ) {
document.getElementById("messageListFrame").contentWindow.location.reload(true);})});', 'text/javascript');
$this->headStyle()->appendStyle('#userName { width:120px; margin-top:10px; margin-bottom:10px; display: inline}
#messageText { width:700px; margin-top:10px;}
');
?>

<div class="well well-small">
   <h3>Group Chat</h3> 
</div>

<iframe src="<?php echo $this->url('groupchat', array('action' => 'messageList')) ?>" width="80%" height="300px" id="messageListFrame"></iframe>
<?php
  //$this->form;
  //$this->form->prepare();
  //$this->form->setAttribute('action', $this->url(NULL,array('controller'=>'Offlinemail', 'action' => 'index')));
  //$this->form->setAttribute('method', 'post');
  // Render the opening tag
  echo $this->form()->openTag($this->form);
  $this->form->setAttribute('class', 'Form');
  // ...loop through and render the form elements...
  echo '<label id="userName">'. $this->userName .': </label>';
  foreach ($this->form as $element) {
     echo $this->formElement($element).'<span>  </span>'; // <-- Magic!
     echo $this->formElementErrors($element).' ';
  }
  // Render the closing tag
 echo $this->form()->closeTag();
?>